
#ifndef _CAVE_
include "main.h"
#endif

#include <glm/glm.hpp>



struct peon {
  float x,y,z; //position
  float direction;
  float angle; //angle
  float speed; //speed
  float realSpeed;

};

/**
  OpenGLContext is a class designed to store all of your OpenGL functions and keep them
  out of the way of your application logic. Here we have the ability to create an OpenGL
  context on a given window and then render to that window.
*/
class OpenGLContext {
public:
  OpenGLContext(void); // Default constructor
#ifndef _CAVE_
  OpenGLContext(HWND hwnd); // Constructor for creating our context given a hwnd
#endif
  ~OpenGLContext(void); // Destructor for cleaning up our application
#ifndef _CAVE_
  bool create30Context(HWND hwnd); // Creation of our OpenGL 3.x context
#endif
  void setupScene(void); // All scene information can be setup here
#ifndef _CAVE_
  void reshapeWindow(int w, int h); // Method to get our window width and height on resize
#endif
  void renderScene(void); // Render scene (display method from previous OpenGL tutorials)
#ifndef _CAVE_
  void updateKeyboard(bool* key);
#endif
  void generatePeon();
  void updatePeon();

  void setViewMatrix(const glm::mat4& mat);
  void setProjectionMatrix(const glm::mat4& mat);
private:
  glm::mat4 getViewMatrix() const;
  glm::mat4 getProjectionMatrix() const ;
  void drawPeon(peon& p) const;

  glm::mat4 ViewMatrix;
  glm::mat4 ProjectionMatrix;
#ifndef _CAVE_
private:
  int windowWidth; // Store the width of our window
  int windowHeight; // Store the height of our window

protected:
  HGLRC hrc; // Rendering context
  HDC hdc; // Device context
  HWND hwnd; // Window identifier
#endif
};
